package com.sms.service.impl;

import java.util.Set;

import com.sms.dao.RoleDAO;
import com.sms.pojo.Role;
import com.sms.service.RoleService;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class RoleServiceImpl implements RoleService {

    @Resource
    private RoleDAO roleDAO;

    @Transactional(propagation = Propagation.SUPPORTS)
    public Set<String> queryAllRoleNameByUserName(String username) {
        return roleDAO.queryAllRoleNameByUserName(username);
    }

    public Role queryRoleByUserId(String userId) {
        return roleDAO.queryRoleByUserId(userId);
    }
}
